package com.twu.biblioteca;

/**
 * Created by sahelig on 12/06/14.
 */
public class Result {
    String message;
    boolean successful;

    public Result(boolean successful, String message) {
        this.message = message;
        this.successful = successful;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Result that = (Result) o;

        if (successful != that.successful) return false;
        if (message != null ? !message.equals(that.message) : that.message != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = message != null ? message.hashCode() : 0;
        result = 31 * result + (successful ? 1 : 0);
        return result;
    }
}
